 <?php 
	include_once "../include/Functions.php";
	//include_once "include/Functions.php";
	
	//$data = file_get_contents("php://input");	
	//$data = utf8_encode($data);
	//$obj = json_decode($data, true);
	
	//$exercise_id= $_GET["exercise_id"];
   //echo "teste";
   //echo $exercise_id;
   
   
	//$person_id = $obj[1];
	//$cont = $obj[2];
	/*
   $sql= "SELECT id_exerc, COUNT(*) AS quant FROM data_exerc GROUP BY id_exerc";
   $mat= Functions::getDataSql($sql);
   
   $cont = count($mat);
   
   for($i=0; $i < $cont; $i++){
      if( $mat[$i]['quant'] > 600){
         $inc = (int) ceil($mat[$i]['quant'] / 600); 
         
         $sql = "SELECT id FROM data_exerc WHERE id_exerc = {$mat[$i]['id_exerc']}";
         $ids = Functions::getDataSql($sql);
         
         $sql = "DELETE FROM data_exerc WHERE id_exerc = {$mat[$i]['id_exerc']} AND id NOT IN (";
         for($j=0; $j < $mat[$i]['quant']; $j+= $inc){
            $sql.= "{$ids[$j]['id']},";
         }
         $sql= rtrim($sql, ",");
         $sql.=");";
         Functions::execSql($sql);
      }
   }*/
   
   
   /*$sql = "SELECT * FROM data_exerc WHERE id_exerc = ".$exercise_id;
   $mat = Functions::getDataSql($sql);
   $tam =  count($mat);
   
	//Save image of path
	$path= "";
	$inc = 1;
	if($tam > 90)
		$inc = (int) ceil($tam / 90);

   echo "Inc = ".$inc." - Tam = ".$tam;
	$path = "http://maps.googleapis.com/maps/api/staticmap?size=250x150&path=color:0xff0000ff|weight:5";
	for( $i=0; $i < $tam; $i+= $inc ) {
		$latitude= round($mat[$i]['lat'], 6);
		$longitude= round($mat[$i]['lon'], 6);
		$path.= "|{$latitude},{$longitude}";
	}				
	//echo $path;
	echo "<script src='https://maps.googleapis.com/maps/api/js?key=AIzaSyDLsD5QOg-xebwva4wTUSCelvjSRAmGT1c&sensor=true'></script>";
	$img = '../tmp/teste.png';
	file_put_contents($img, file_get_contents($path));	   */
   
   $unix_date = strtotime("2015-05-10T19:29:01Z");
   echo $unix_date * 1000;
?>